(define (length lst)
  (if (pair? lst)
    (+ 1 (length (cdr lst)))
    0))

(display-line (length '()))
(display-line (length '(1)))
(display-line (length '(1 2)))
(display-line (length '(1 2 3)))
(display-line (length '(1 2 3 4)))
